package com.power.sifa.approve.model.enumeration;

import java.util.ArrayList;
import java.util.List;

/**
 * 流程状态常量类
 */
public class St_apply {

    /**
     * 未提交
     */
    public static final int WRITTEN = 6000600;

    /**
     * 已提交
     */
    public static final int COMMIT = 6000601;

    /**
     * 撤回
     */
    public static final int BACK = 6000602;

    /**
     * 已受理
     */
    public static final int ACCEPT = 6000606;

    /**
     * 不予受理
     */
    public static final int UNACCEPT = 6000607;

    /**
     * 已办结
     */
    public static final int FINISH = 6000608;

    /**
     * 已归档
     */
    public static final int ARCHIVE = 6000609;


    // 属于已完成的业务状态列表
    public static List COMPLETELIST = new ArrayList<>(10);
    static {
        COMPLETELIST.add(St_apply.BACK);
        COMPLETELIST.add(St_apply.UNACCEPT);
        COMPLETELIST.add(St_apply.FINISH);
        COMPLETELIST.add(St_apply.ARCHIVE);
    }

    public static List ALLLIST = new ArrayList<>(10);
    static {
        ALLLIST.add(St_apply.WRITTEN);
        ALLLIST.add(St_apply.COMMIT);
        ALLLIST.add(St_apply.ACCEPT);
        ALLLIST.add(St_apply.UNACCEPT);
        ALLLIST.add(St_apply.FINISH);
        ALLLIST.add(St_apply.ARCHIVE);
    }

    public static String getName(int status) {
        switch (status) {
            case WRITTEN:
                return "未提交";
            case COMMIT:
                return "已提交";
            case BACK:
                return "撤回";
            case ACCEPT:
                return "已受理";
            case UNACCEPT:
                return "不予受理";
            case FINISH:
                return "已办结";
            case ARCHIVE:
                return "已归档";
            default:
                return "未知";
        }
    }

    public static String judge(int status) {
        switch (status) {
            case COMMIT:
            case BACK:
            case UNACCEPT:
                return "受理";

            case ACCEPT:
            case FINISH:
            case ARCHIVE:
                return "审理";

            default:
                return "未知";
        }
    }

}
